//
//  ST_PeculiaritySquareTypeSupplementView.swift
//  btvideo
//
//  Created by mac on 2020/1/15.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SnapKit
import SwifterSwift

class ST_PeculiaritySquareTypeSupplementView: UICollectionReusableView {
        
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        self.addSubview(cover_image_view)
        self.addSubview(titleLabel)
//        self.addSubview(content_label)
        cover_image_view.snp.makeConstraints { (make) in
            make.top.bottom.left.right.equalToSuperview()
        }
        titleLabel.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(36)
            make.top.equalToSuperview().offset(92-20+statusBarHeight)
            
        }
        
//        content_label.snp.makeConstraints { (make) in
//            make.left.equalTo(titleLabel)
//            make.top.equalTo(titleLabel.snp.bottom).offset(13)
//        }
        
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate lazy var cover_image_view:UIImageView = {
        let control = UIImageView()
        control.contentMode = UIView.ContentMode.scaleAspectFill
        control.clipsToBounds = true
        return control
    }()
    
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel.init()
        control.text = ""
        control.textColor = Color.white
        //        control.numberOfLines = 0
        //        control.textAlignment = .center
        control.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.semibold)
        return control
    }()
    
//    fileprivate lazy var content_label:UILabel = {
//        let control = UILabel.init()
//        control.text = ""
//        control.textColor = Color.white
//        //        control.numberOfLines = 0
//        //        control.textAlignment = .center
//        control.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.medium)
//        return control
//    }()
    
    var model = ST_PeculiaritySquareCollectionCellModel(){
        didSet{
            
            
            cover_image_view.pin_setImage(from: model.moreDataBackgroundImageUrl.compress_image().url, placeholderImage: ST_SwiftConst.shared.fetch_random_place_holder_image())
            
            
            titleLabel.text = model.title
        }
    }
}
